home *** CD-ROM | disk | FTP | other *** search
/ Borland JBuilder 6 / jbuilder6.iso / IBM VisualAge for Java Enterprise v4.0 Retail / ivj40 / setup / IDE.Cab / F76747_BasicWorkbookUIButtonHandler.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-04-25  |  1.7 KB  |  49 lines

  1. package com.ibm.ivb.jface.basic;
  2.  
  3. import com.ibm.ivb.jface.parts.WorkbookPage;
  4. import java.awt.event.ActionEvent;
  5. import java.awt.event.ActionListener;
  6. import java.util.EventObject;
  7.  
  8. class BasicWorkbookUI$ButtonHandler implements ActionListener {
  9.    // $FF: synthetic field
  10.    private final BasicWorkbookUI this$0;
  11.  
  12.    public void actionPerformed(ActionEvent var1) {
  13.       Object var2 = ((EventObject)var1).getSource();
  14.       if (var2 == this.this$0.right) {
  15.          int var3 = this.this$0.wb.getPageCount();
  16.          if (this.this$0.firstPage + 1 < var3) {
  17.             ++this.this$0.firstPage;
  18.             if (this.this$0.visiblePage != null && this.this$0.wb.getCurrentPageNumber() >= this.this$0.firstPage && this.this$0.wb.getCurrentPageNumber() <= this.this$0.lastPage) {
  19.                this.this$0.wb.invalidate();
  20.                this.this$0.wb.validate();
  21.                this.this$0.wb.repaint();
  22.                return;
  23.             }
  24.  
  25.             WorkbookPage var4 = this.this$0.wb.getPageAt(this.this$0.firstPage);
  26.             this.this$0.wb.showPage(var4);
  27.             return;
  28.          }
  29.       } else if (var2 == this.this$0.left && this.this$0.firstPage > 0) {
  30.          --this.this$0.firstPage;
  31.          if (this.this$0.visiblePage != null && this.this$0.wb.getCurrentPageNumber() >= this.this$0.firstPage && this.this$0.wb.getCurrentPageNumber() <= this.this$0.lastPage) {
  32.             this.this$0.wb.invalidate();
  33.             this.this$0.wb.validate();
  34.             this.this$0.wb.repaint();
  35.             return;
  36.          }
  37.  
  38.          WorkbookPage var5 = this.this$0.wb.getPageAt(this.this$0.firstPage);
  39.          this.this$0.wb.showPage(var5);
  40.       }
  41.  
  42.    }
  43.  
  44.    BasicWorkbookUI$ButtonHandler(BasicWorkbookUI var1) {
  45.       this.this$0 = var1;
  46.       this.this$0 = var1;
  47.    }
  48. }
  49.